<?php
/*
# ------------------------------------------------------------------------
# JA Teline III - Version 1.3 - Licence Owner jSharing.COM
# ------------------------------------------------------------------------
# Copyright (C) Lifetime Joomla Just for Sharing, Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: Joomla Just for Sharing
# Websites:  http://jsharing.com -  http://jsharing.net
# This file may not be redistributed in whole or significant part.
# ------------------------------------------------------------------------
*/
		//get Itemid of category
		/*
		if ($catorsec) {
			$catlink   = JRoute::_(ContentHelperRoute::getCategoryRoute($rows[0]->catslug, $rows[0]->sectionid));
		}else{
			$catlink   = JRoute::_(ContentHelperRoute::getSectionRoute($rows[0]->sectionid));
		$cattitle = ($catorsec) ? $rows[0]->cattitle:$rows[0]->sectitle;
		$catdesc = ($catorsec) ? $rows[0]->catdesc:$rows[0]->secdesc;
		}*/
		$rows = $cat->contents;
		$cid = $cat->category->id;
		$slug = $cat->category->slug;
		$ctitle = $cat->category->title;
		$cdesc = $cat->category->description;
		$clink   = JRoute::_(ContentHelperRoute::getCategoryRoute($slug, $sid));
		
		$cls_sufix = trim($params->get('blog_theme',''));
		
		if($cls_sufix) $cls_sufix = '-'.$cls_sufix;
?>
		<div class="ja-box column ja-zintheme<?php echo $cls_sufix;?>">
		<div class="inner clearfix">
		<?php if ($showcattitle) : ?>
		<div class="ja-zincat clearfix">
			<h3>
				<a href="<?php echo $clink;?>" title="<?php echo trim(strip_tags($cdesc));?>">
					<span><?php echo $ctitle;?></span>
				</a>
			</h3>
		</div>
		<?php endif; ?>
<?php
		$i = 0;
		while($i < $s_introitems && $i<count($rows)) {
			$row = $rows[$i];
			$link   = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
			$image = $helper->replaceImage ($row, $img_align, $autoresize, $maxchars, $s_showimage, $img_w, $img_h, $hiddenClasses);
			//Show the latest news
?>
			<div class="ja-zincontent clearfix">

				<?php if ($s_showimage && $image) : ?>
				<div class="ja-zinimg" style="width:<?php echo $img_w;?>px;height:<?php echo $img_h;?>px;">
					<?php echo $image; ?>
				</div>
				<?php endif; ?>
			
				<h4 class="ja-zintitle"><a href="<?php echo $link;?>" title="<?php echo strip_tags($row->title);?>"><?php echo $row->title;?></a></h4>
				
				<?php if ($showcreater||$showdate) : ?>
					<div class="ja-zinmeta clearfix">
						<?php if ($showdate) : ?>
							<span class="createdate"><?php echo JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC4'));?> <?php if ($showcreater) : ?> &nbsp;|&nbsp; <?php endif; ?> </span>
						<?php endif; ?>
						<?php if ($showcreater) : ?>
							<span class="createby"><?php echo $row->creater;?></span>						
						<?php endif; ?>
					</div>
				<?php endif; ?>

				<?php 
				     if($maxchars > strlen($row->introtext1)) {
				      echo $row->introtext;
				     } else {
				      echo $row->introtext1;
				     }
				?>
				<?php if ($showreadmore) : ?>
				<a href="<?php echo $link; ?>" class="readon" title="<?php echo JText::sprintf('Read more...');?>"><span><?php echo JText::sprintf('Read more...');?></span></a>
				<?php endif; ?>
			</div>
<?php
			$i++;
		}
		
		if (count ($rows) > $i) {
			echo "<div class=\"ja-zinlinks\">\n";
			echo "<strong>".JTEXT::_('More:')."</strong>\n";
			echo "<ul>\n";
  		
  		while (count ($rows) > $i) {
  			$row = $rows[$i];
  			$link   = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid.""));
?>
  			<li>
  			<a title="<?php echo trim(strip_tags($row->title), '"'); ?>" href="<?php echo $link; ?>">
  			<?php echo $row->title; ?></a>
  			</li>
<?php
  			$i++;
  		}
  		echo "</ul></div>\n";
		} 
?>
		</div>
		</div>
